import { FC } from "react";
import { View, Text } from "@tarojs/components";
import Sestion from "../sestion";
import styles from "./index.module.less";
import { UserInfo } from "@/service/type";

interface IProps {
  customerInfo: UserInfo;
  userInfo: UserInfo;
}

const MemberAsset: FC<IProps> = ({ customerInfo, userInfo }) => {
  const familyStructureCn =
    customerInfo.customerEconomicInfo?.familyStructureCn;
  const houseCn = customerInfo.customerEconomicInfo?.houseCn;
  const labels = familyStructureCn
    ?.split(",")
    .concat(houseCn?.split(",") || []);

  return (
    <Sestion text="家庭与房车">
      <View className={styles["label-wrapper"]}>
        {labels?.map((item, index) => (
          <Text className={styles["item"]} key={index}>
            {item}
          </Text>
        ))}
      </View>

      {userInfo.certificationState === "0" && (
        <View className={styles["hint"]}>实名后可以查看更多</View>
      )}
    </Sestion>
  );
};

export default MemberAsset;
